package com.jnzc.ocr.serv.shop.api.impl;

import com.jnzc.ocr.common.bean.Tree;
import com.jnzc.ocr.common.utils.TreeUtils;
import com.jnzc.ocr.serv.shop.api.ShopProductAttrApi;
import com.jnzc.ocr.serv.shop.entity.ShopProductAttr;
import com.jnzc.ocr.serv.shop.service.ShopProductAttrService;
import com.jnzc.ocr.serv.shop.vo.ShopProductAttrSaveVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhangcm
 * @version 1.0, 2017-09-29
 */
@RestController
public class ShopProductAttrApiImpl implements ShopProductAttrApi {

    @Autowired
    private ShopProductAttrService shopProductAttrService;

    @Override
    public List<Tree<ShopProductAttr>> listTree(Long shopId) {
        return shopProductAttrService.listTree(shopId);
    }

    @Override
    public void save(@RequestBody ShopProductAttrSaveVo param, Long shopId) {
        shopProductAttrService.save(param, shopId);
    }

    @Override
    public void delete(Long id, Long shopId) {
        shopProductAttrService.delete(id, shopId);
    }
}
